package a.f.g;

import a.c.ab;
import a.c.m;
import a.c.x;
import a.d.s;
import a.f.c.g;
import a.f.c.h;
import a.f.g.a.bc;
import a.f.g.a.eb;
import a.f.g.a.fb;
import a.f.g.a.ob;
import a.f.g.a.xb;
import a.f.g.a.zb;
import a.f.ib;
import a.f.mb;
import a.f.*;
import a.f.z;
import a.i.p;
import a.i.wb;
import a.i.y;

import java.awt.geom.Rectangle2D;
import java.util.HashSet;

import a.i.y;
import a.c.x;
import a.d.s;
import a.i.p;
import a.c.ab;
import a.i.wb;

public class f
  extends mb
{
  private long w;
  private double x = 0.6D;
  private long y = 30000L;
  public static final byte z = 0;
  public static final byte A = 2;
  public static final byte B = 1;
  public static final Object C = e.w;
  public static final Object D = "y.layout.organic.SmartOrganicLayouter.GROUP_NODE_MODE_DATA";
  public static final Object E = "GROUP_NODE_MODE_NORMAL";
  public static final Object F = "GROUP_NODE_MODE_FIX_BOUNDS";
  public static final Object G = "GROUP_NODE_MODE_FIX_CONTENTS";
  public static final Object H = e.I;
  private byte I = 0;
  private double J = 0.5D;
  private double K = 0.4D;
  private double L = 40.0D;
  private double M = this.L;
  private boolean N;
  private boolean O;
  private static final double P = 0.1D;
  private double Q;
  private boolean R;
  private g S = new a.f.c.k();
  private j T = j.a;
  private boolean U;
  private static final short V = 1;
  private static final short W = 2;
  private static final short X = 3;
  private short Y = 1;
  private boolean Z;
  private double ab;
  private boolean bb = false;
  private double cb = 0.5D;
  private boolean db = true;
  private boolean eb;
  private x fb;
  private static final double gb = 1.E-005D;
  public static boolean hb;
  
  public double a()
  {
    return this.K;
  }
  
  public void a(double paramDouble)
  {
    boolean bool = j.c;
    if ((bool) || (paramDouble >= 0.0D)) {
      if (!bool)
      {
        if (paramDouble <= 1.0D) {
          this.K = paramDouble;
        }
      }
      else if (j.b == 0) {
        return;
      }
    }
    throw new IllegalArgumentException(paramDouble + " not in [0,1]");
  }
  
  public boolean s()
  {
    return this.db;
  }
  
  public void h(boolean paramBoolean)
  {
    this.db = paramBoolean;
  }
  
  public boolean t()
  {
    return this.bb;
  }
  
  public void i(boolean paramBoolean)
  {
    this.bb = paramBoolean;
  }
  
  public double u()
  {
    return this.cb;
  }
  
  public void b(double paramDouble)
  {
    if ((j.c) || ((paramDouble < 0.0D) || (paramDouble > 1.0D))) {
      throw new IllegalArgumentException("Quality must be within [0,1]");
    }
    this.cb = paramDouble;
  }
  
  public boolean v()
  {
    return this.eb;
  }
  
  public void j(boolean paramBoolean)
  {
    this.eb = paramBoolean;
  }
  
  public f()
  {
    d(false);
    ((ib)c()).a((byte)1);
  }
  
  public g w()
  {
    return this.S;
  }
  
  public boolean x()
  {
    return this.Z;
  }
  
  public void k(boolean paramBoolean)
  {
    this.Z = paramBoolean;
  }
  
  public void a(g paramg)
  {
    if (paramg == null) {
      throw new NullPointerException();
    }
    this.S = paramg;
  }
  
  public boolean y()
  {
    return this.U;
  }
  
  public void l(boolean paramBoolean)
  {
    this.U = paramBoolean;
  }
  
  protected void a(a.f.o paramo, a.f.t paramt)
  {
    boolean bool = j.c;
    if (!bool) {
      if (this.Z) {
        if (this.I != 0)
        {
          if (!bool) {}
          paramt.a((byte)(32 + (this.R ? 0 : 64)));
          if (!this.R) {
            paramt.b(P());
          }
          a.c.k localk = paramo.c(C);
          if (bool) {
            return;
          }
          if (localk != null)
          {
            paramo.a(a.f.t.h, new p()
            {
              private final a.c.k val$subsetDataProvider;
              
              public Object get(Object paramAnonymousObject)
              {
                if (!this.val$subsetDataProvider.getBool(paramAnonymousObject)) {
                  return "nonfixed";
                }
                return null;
              }
            });
            if (bool) {
              return;
            }
            if (j.b == 0) {}
          }
        }
        else
        {
          paramt.a((byte)(paramt.h() & 0xFFFFFFDF));
        }
      }
    }
    this.ab = paramt.f();
    paramt.b(Math.max(this.ab, this.Q));
  }
  
  public void doLayout(a.f.o paramo)
  {
    boolean bool = j.c;
    a.c.n localn1 = paramo.C();
    x localx = paramo.B();
    a(paramo, localn1, localx, I());
    Object localObject1 = null;
    a.d.w localw = null;
    Object localObject2 = paramo.v();
    while (((a.c.w)localObject2).e())
    {
      localObject3 = ((a.c.w)localObject2).d();
      if (!bool)
      {
        if (!localx.getBool(localObject3))
        {
          localObject1 = localObject3;
          localw = paramo.o((a.c.e)localObject3);
          break;
        }
        ((a.c.w)localObject2).f();
      }
    }
    localObject2 = null;
    if (this.bb)
    {
      localObject2 = new c_(paramo);
      ((c_)localObject2).a(localx);
    }
    Object localObject3 = null;
    if ((bool) || ((e() instanceof a.f.t)))
    {
      localObject3 = (a.f.t)e();
      a(paramo, (a.f.t)localObject3);
    }
    a.f.db localdb = null;
    a.c.n localn2 = null;
    if ((bool) || ((o()) && ((bool) || ((d() instanceof a.f.db)))))
    {
      localdb = (a.f.db)d();
      if ((bool) || (paramo.c(a.f.db.h) == null)) {
        paramo.a(a.f.db.h, localn2 = localn1);
      }
    }
    ib localib = null;
    p local7 = null;
    if ((bool) || ((k()) && ((bool) || ((c() instanceof ib)))))
    {
      localib = (ib)c();
      a.c.k localk = paramo.c(ib.h);
      if (localk == null)
      {
        local7 = new p()
        {
          private final x val$laidOutNodes;
          
          public boolean getBool(Object paramAnonymousObject)
          {
            boolean bool = j.c;
            if (!bool) {
              if ((paramAnonymousObject instanceof a.c.d))
              {
                a.c.d locald = (a.c.d)paramAnonymousObject;
                if (!bool) {}
                return !this.val$laidOutNodes.getBool(locald.e());
              }
            }
            return false;
          }
        };
        paramo.a(ib.h, local7);
      }
    }
    try
    {
      super.doLayout(paramo);
    }
    finally
    {
      if (localObject3 != null) {
        b(paramo, (a.f.t)localObject3);
      }
      if (localn2 != null) {
        paramo.j(a.f.db.h);
      }
      if (local7 != null) {
        paramo.j(ib.h);
      }
      paramo.a(localn1);
      paramo.a(localx);
      if (this.bb) {
        ((c_)localObject2).a();
      }
      if (localObject1 != null)
      {
        double d1 = localw.a - paramo.m(localObject1);
        double d2 = localw.b - paramo.n(localObject1);
        if ((bool) || ((d1 != 0.0D) || (d2 != 0.0D))) {
          wc.b(paramo, paramo.v(), d1, d2);
        }
      }
    }
  }
  
  protected void b(a.f.o paramo, a.f.t paramt)
  {
    if (this.Z) {
      paramo.j(a.f.t.h);
    }
    paramt.b(this.ab);
  }
  
  protected boolean b(a.f.o paramo)
  {
    return paramo != null;
  }
  
  private void e(a.f.o paramo)
  {
    boolean bool = j.c;
    int j = j.b;
    if (this.eb)
    {
      h localh = new h(paramo);
      this.fb = paramo.B();
      a.c.w localw = paramo.v();
      label164:
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (j != 0) {
          break label295;
        }
        if (!bool)
        {
          if (!localh.e(locale))
          {
            a.d.t localt = paramo.v(locale);
            xc[] arrayOfxc = paramo.f(locale);
            int i = 0;
            do
            {
              if (i >= arrayOfxc.length) {
                break;
              }
              xc localxc = arrayOfxc[i];
              localt = a(localt, localxc.c());
              i++;
              if ((!bool) && (j != 0)) {
                break label164;
              }
            } while (j == 0);
            if (!bool) {
              this.fb.a(locale, paramo.u(locale));
            }
            a.d.w localw1 = paramo.o(locale);
            double d1 = Math.floor(Math.max(localw1.a() - localt.d(), localt.d() + localt.b() - localw1.a()) + 1.E-005D);
            double d2 = Math.floor(Math.max(localw1.b() - localt.e(), localt.e() + localt.c() - localw1.b()) + 1.E-005D);
            paramo.b(locale, 2.0D * d1, 2.0D * d2);
            paramo.a(locale, localw1);
          }
          localw.f();
        }
      } while (j == 0);
      if (!bool) {
        label295:
        localh.e();
      }
    }
  }
  
  private void f(a.f.o paramo)
  {
    boolean bool = j.c;
    int i = j.b;
    if (this.eb)
    {
      a.c.w localw = paramo.v();
      do
      {
        if (!localw.e()) {
          break;
        }
        a.c.e locale = localw.d();
        if (i != 0) {
          return;
        }
        if (this.fb.get(locale) != null)
        {
          a.d.w localw1 = paramo.o(locale);
          paramo.a(locale, (s)this.fb.get(locale));
          paramo.a(locale, localw1);
        }
        localw.f();
      } while (i == 0);
      if (!bool) {
        paramo.a(this.fb);
      }
    }
  }
  
  private a.d.t a(a.d.t paramt1, a.d.t paramt2)
  {
    boolean bool = j.c;
    if (!bool) {
      if (paramt1 != null)
      {
        if (bool) {
          break label39;
        }
        if (paramt2 != null) {
          break label38;
        }
      }
    }
    if (!bool) {}
    return paramt1 == null ? paramt2 : paramt1;
    label38:
    label39:
    double d1 = Math.min(paramt1.d(), paramt2.d());
    double d2 = Math.max(paramt1.d() + paramt1.b(), paramt2.d() + paramt2.b());
    double d3 = Math.min(paramt1.e(), paramt2.e());
    double d4 = Math.max(paramt1.e() + paramt1.c(), paramt2.e() + paramt2.c());
    return new a.d.t(d1, d3, d2 - d1, d4 - d3);
  }
  
  private a.c.k a(a.f.o paramo, a.c.k paramk)
  {
    boolean bool = j.c;
    int i = j.b;
    h localh = new h(paramo);
    x localx1 = a.i.db.a();
    x localx2 = a.i.db.a();
    Object localObject1 = paramo.v();
    do
    {
      if (!((a.c.w)localObject1).e()) {
        break;
      }
      localObject2 = ((a.c.w)localObject1).d();
      if (!bool)
      {
        if (i != 0) {
          break label100;
        }
        localx2.a(localObject2, paramk.getBool(localObject2));
        ((a.c.w)localObject1).f();
      }
    } while (i == 0);
    label100:
    localObject1 = paramo.c(D);
    Object localObject2 = paramo.v();
    label267:
    label269:
    do
    {
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break label272;
        }
        a.c.e locale1 = ((a.c.w)localObject2).d();
        if (bool) {
          break label281;
        }
        if (i != 0) {
          break label278;
        }
        if (((bool) || (localh.e(locale1))) && ((bool) || ((a(locale1, (a.c.k)localObject1)) && (!localx1.getBool(locale1)))))
        {
          a.c.bb localbb = localh.d(locale1);
          a.c.w localw = localbb.l();
          do
          {
            if (!localw.e()) {
              break;
            }
            a.c.e locale2 = localw.d();
            localx2.a(locale2, false);
            localx1.a(locale2, true);
            localw.f();
            if (bool) {
              break label269;
            }
            if (i != 0) {
              break label267;
            }
          } while (i == 0);
        }
      } while (bool);
      ((a.c.w)localObject2).f();
    } while (i == 0);
    label272:
    if (!bool) {
      label278:
      localh.e();
    }
    label281:
    return localx2;
  }
  
  private boolean a(a.c.e parame, a.c.k paramk)
  {
    boolean bool = j.c;
    if (!bool) {}
    return (this.Y == 2) || (((bool) || (paramk != null)) && (paramk.get(parame) == G));
  }
  
  private boolean a(a.c.e parame, a.c.k paramk, a.f.o paramo)
  {
    boolean bool = j.c;
    if (this.Y == 3)
    {
      a.c.k localk = paramo.c(a.f.g.a.t.a);
      if ((bool) || (localk != null)) {
        return localk.getBool(parame);
      }
      return true;
    }
    return ((bool) || (paramk != null)) && (paramk.get(parame) == F);
  }
  
  protected void a(a.f.o paramo)
  {
    boolean bool2 = j.c;
    int i = j.b;
    h(paramo);
    e(paramo);
    B();
    boolean bool1 = h.c(paramo);
    a.c.k localk = paramo.c(C);
    if (localk != null)
    {
      if (!bool2) {
        if (this.I == 0) {
          paramo.j(C);
        }
      }
      if ((bool2) || ((i != 0) && (!bool1))) {
        paramo.a(C, a(paramo, localk));
      }
    }
    d locald = D();
    Object localObject1;
    if (locald != null) {
      if (!bool2)
      {
        if (!bool1)
        {
          if (bool2) {
            break label188;
          }
          if (this.Y != 1) {}
        }
        else
        {
          a(locald);
          locald.doLayout(paramo);
        }
      }
      else
      {
        if (bool2) {
          break label188;
        }
        if (!bool1)
        {
          localObject1 = new k_(paramo);
          new a.f.c.e(null, new e_(new d_(w(), (a.c.k)localObject1))).doLayout(paramo);
        }
      }
    }
    label188:
    Object localObject2;
    if (!bool2) {
      if (!C())
      {
        if (bool2) {
          break label582;
        }
        if (this.x > 0.1D)
        {
          if (!bool2) {
            if (z())
            {
              if (bool2) {
                break label579;
              }
              localObject1 = i(paramo);
              if (localObject1 == null) {
                break label578;
              }
              this.T.a((a.f.g.a.d)localObject1, paramo);
              ((a.f.g.a.d)localObject1).h(false);
              localObject2 = paramo.c(a.f.db.h);
              Object localObject3;
              if (localObject2 != null)
              {
                localObject3 = paramo.w();
                do
                {
                  if (!((m)localObject3).e()) {
                    break;
                  }
                  if (bool2) {
                    break label347;
                  }
                  if (i != 0) {
                    break label346;
                  }
                  if (((a.c.k)localObject2).getBool(((m)localObject3).a())) {
                    wc.b(paramo, ((m)localObject3).a());
                  }
                  ((m)localObject3).f();
                } while (i == 0);
              }
              if (!bool2)
              {
                label346:
                if (this.Y == 2) {
                  label347:
                  if (!h.c(paramo))
                  {
                    localObject3 = new h(paramo);
                    HashSet localHashSet = new HashSet(((h)localObject3).c(((h)localObject3).d()));
                    ((h)localObject3).e();
                    z localz = new z();
                    paramo.a(z.g, new p()
                    {
                      private final HashSet val$topLevelNodes;
                      private final a.f.g.a.d val$mainPlacement;
                      
                      public Object get(Object paramAnonymousObject)
                      {
                        if ((j.c) || (this.val$topLevelNodes.contains(paramAnonymousObject))) {
                          return this.val$mainPlacement;
                        }
                        return null;
                      }
                    });
                    a.f.c.e locale = new a.f.c.e(localz);
                    locale.a(new g()
                    {
                      public Rectangle2D a(a.f.o paramAnonymouso, a.c.e paramAnonymouse, a.c.bb paramAnonymousbb)
                      {
                        zc localzc = paramAnonymouso.k(paramAnonymouse);
                        return new Rectangle2D.Double(localzc.a(), localzc.b(), localzc.c(), localzc.d());
                      }
                    });
                    locale.doLayout(paramo);
                    if (bool2) {
                      break label466;
                    }
                    if (i == 0) {
                      break label465;
                    }
                  }
                }
                ((a.f.g.a.d)localObject1).doLayout(paramo);
                label465:
                label466:
                if (bool2) {
                  break label529;
                }
                if (!bool1)
                {
                  localObject3 = new k_(paramo);
                  new a.f.c.e(null, new e_(new d_(w(), (a.c.k)localObject3))).doLayout(paramo);
                }
              }
              this.T.c((a.f.g.a.d)localObject1, paramo);
              label529:
              if (bool2) {
                break label582;
              }
              if (i == 0) {
                break label578;
              }
            }
          }
          if (bool2) {
            break label579;
          }
          localObject1 = F();
          if (localObject1 != null)
          {
            localObject2 = new k_(paramo);
            a((e)localObject1, (a.c.k)localObject2);
            ((e)localObject1).doLayout(paramo);
          }
        }
      }
    }
    label578:
    label579:
    label582:
    if ((bool2) || (!this.R))
    {
      if (!bool2) {
        if (this.I != 0)
        {
          localObject1 = paramo.c(C);
          if (localObject1 != null) {
            paramo.a(l.f, new p()
            {
              private final a.c.k val$subsetProvider;
              
              public boolean getBool(Object paramAnonymousObject)
              {
                if (!j.c) {}
                return !this.val$subsetProvider.getBool(paramAnonymousObject);
              }
            });
          }
        }
      }
      if (!bool2) {
        if (!bool1)
        {
          localObject1 = new l();
          if (!bool2)
          {
            if (this.I != 0) {
              ((l)localObject1).b(false);
            }
            ((l)localObject1).a((byte)2);
            ((l)localObject1).a(this.Q);
            ((l)localObject1).a(false);
          }
          localObject2 = new k_(paramo);
          new a.f.c.e((rc)localObject1, new e_(new d_(w(), (a.c.k)localObject2))).doLayout(paramo);
          if (bool2) {
            break label862;
          }
          if (i == 0) {
            break label858;
          }
        }
      }
      if ((bool2) || (this.I == 0))
      {
        localObject1 = this.O ? new wb(42L) : new wb();
        localObject2 = new k((wb)localObject1, this.Q);
        ((k)localObject2).doLayout(paramo);
        if (bool2) {
          break label862;
        }
        if (i == 0) {}
      }
      else
      {
        localObject1 = new l();
        ((l)localObject1).b(false);
        ((l)localObject1).a((byte)2);
        ((l)localObject1).a(this.Q);
        ((l)localObject1).a(false);
        ((l)localObject1).doLayout(paramo);
      }
      label858:
      if (this.I != 0) {
        label862:
        paramo.j(l.f);
      }
    }
    if (localk != null) {
      paramo.a(C, localk);
    }
    g(paramo);
    f(paramo);
  }
  
  private void g(a.f.o paramo)
  {
    boolean bool = j.c;
    int i = j.b;
    if (!bool) {}
    switch (this.Y)
    {
    case 1: 
    default: 
      if (!bool) {
        if (i == 0) {
          break label74;
        }
      }
    case 3: 
      paramo.j(a.f.g.a.t.a);
      if (bool) {
        return;
      }
      if (i == 0) {
        break label74;
      }
    }
    paramo.j(e.x);
    label74:
    this.Y = 1;
  }
  
  private static void a(a.f.o paramo, a.c.i parami1, a.c.i parami2, int paramInt)
  {
    boolean bool3 = j.c;
    int m = j.b;
    a.c.k localk1 = paramo.c(C);
    a.c.k localk2 = paramo.c(D);
    Object localObject1;
    Object localObject2;
    if ((bool3) || ((localk2 != null) || (localk1 != null)))
    {
      localObject1 = new int[paramo.j()];
      a.c.w localw;
      int k;
      label195:
      label198:
      boolean bool1;
      if (localk1 != null)
      {
        if (bool3) {
          break label308;
        }
        if (paramInt != 0)
        {
          if ((bool3) || (paramInt == 1))
          {
            localObject2 = new int[paramo.j()];
            x localx = a.i.db.a((int[])localObject2);
            b.a(paramo, localk1, localx);
            localw = paramo.v();
          }
          while (localw.e())
          {
            boolean bool2 = localk1.getBool(localw.d());
            k = localObject2[localw.d().f()];
            if (m != 0) {
              break label666;
            }
            if (!bool3) {
              if (!bool2)
              {
                if ((!bool3) && (k < 0)) {
                  break label198;
                }
                if (bool3) {
                  break label195;
                }
              }
            }
            localObject1[localw.d().f()] = (k < 5 ? 0 : 1);
            localw.f();
            if (m != 0)
            {
              if (bool3) {
                break label300;
              }
              localObject2 = paramo.v();
              do
              {
                if (!((a.c.w)localObject2).e()) {
                  break;
                }
                bool1 = localk1.getBool(((a.c.w)localObject2).d());
                if (m != 0) {
                  break label666;
                }
                if (!bool3) {}
                localObject1[localObject2.d().f()] = (bool1 ? 0 : 1);
                ((a.c.w)localObject2).f();
              } while (m == 0);
            }
          }
        }
      }
      label401:
      if (!bool3) {
        label300:
        if (!bool3) {
          if (h.b(paramo))
          {
            label308:
            localObject2 = new h(paramo);
            try
            {
              bool1 = false;
              localw = paramo.v();
              a.c.e locale1;
              Object localObject3;
              do
              {
                if (!localw.e()) {
                  break;
                }
                locale1 = localw.d();
                if (m != 0) {
                  break label518;
                }
                if (((h)localObject2).e(locale1))
                {
                  if (!bool3) {
                    if ((paramInt != 0) && ((bool3) || (localk1 != null))) {
                      if (bool3) {
                        break label401;
                      }
                    }
                  }
                  k = localk1.getBool(locale1) ? 1 : 0;
                  if (!bool3) {}
                  localObject3 = localk2 != null ? localk2.get(locale1) : null;
                  if (!bool3) {
                    if (localObject3 == null) {
                      localObject3 = E;
                    }
                  }
                  if (!bool3) {
                    if ((localObject3 == G) && (k != 0)) {
                      bool1++;
                    }
                  }
                  if (localObject3 == F)
                  {
                    if (!bool3) {}
                    localObject1[locale1.f()] = (k != 0 ? 0 : 1);
                  }
                }
                localw.f();
              } while (m == 0);
              if ((!bool3) && (bool1))
              {
                localw = paramo.v();
                do
                {
                  if (!localw.e()) {
                    break;
                  }
                  locale1 = localw.d();
                  a.c.e locale2 = ((h)localObject2).b(locale1);
                  if (m != 0) {
                    break label653;
                  }
                  localObject3 = null;
                  do
                  {
                    do
                    {
                      if (locale2 == ((h)localObject2).d()) {
                        break;
                      }
                      if (localk2.get(locale2) == G) {
                        localObject3 = locale2;
                      }
                      locale2 = ((h)localObject2).b(locale2);
                    } while (m == 0);
                  } while (bool3);
                  if (localObject3 != null) {
                    localObject1[locale1.f()] = (((a.c.e)localObject3).f() + 2);
                  }
                  localw.f();
                } while (m == 0);
              }
              if (bool3) {}
            }
            finally
            {
              ((h)localObject2).e();
            }
          }
        }
      }
      label518:
      label653:
      label666:
      localObject2 = paramo.w();
      label768:
      label806:
      do
      {
        if (!((m)localObject2).e()) {
          break;
        }
        a.c.d locald = ((m)localObject2).a();
        int i = localObject1[locald.e().f()];
        int j = localObject1[locald.f().f()];
        if ((!bool3) && (m != 0)) {
          return;
        }
        if (!bool3)
        {
          if (i != 0)
          {
            if (bool3) {
              break label768;
            }
            if (j != 0) {}
          }
          else
          {
            parami1.a(locald, true);
          }
        }
        else
        {
          if (bool3) {
            continue;
          }
          if (m == 0) {
            break label806;
          }
        }
        if (!bool3)
        {
          if (i != j) {
            parami1.a(locald, true);
          }
        }
        else
        {
          if (bool3) {
            continue;
          }
          if (m == 0) {
            break label806;
          }
        }
        parami1.a(locald, false);
        ((m)localObject2).f();
      } while (m == 0);
      if (!bool3) {
        localObject2 = paramo.v();
      }
    }
    else
    {
      while (((a.c.w)localObject2).e())
      {
        if (!bool3) {}
        parami2.a(((a.c.w)localObject2).d(), localObject1[localObject2.d().f()] == 0);
        ((a.c.w)localObject2).f();
        if (m != 0)
        {
          localObject1 = paramo.w();
          do
          {
            if (!((m)localObject1).e()) {
              break;
            }
            localObject2 = ((m)localObject1).a();
            parami1.a(localObject2, true);
            ((m)localObject1).f();
            if ((!bool3) && (m != 0)) {
              return;
            }
          } while (m == 0);
          if (!bool3)
          {
            localObject1 = paramo.v();
            do
            {
              if (!((a.c.w)localObject1).e()) {
                break;
              }
              parami2.a(((a.c.w)localObject1).d(), true);
              ((a.c.w)localObject1).f();
            } while (m == 0);
          }
        }
      }
    }
  }
  
  private void h(a.f.o paramo)
  {
    boolean bool = j.c;
    int m = j.b;
    this.Y = 1;
    a.c.k localk1 = paramo.c(C);
    a.c.k localk2 = paramo.c(D);
    if (((!bool) && (localk2 != null)) || ((localk1 != null) && (h.b(paramo))))
    {
      h localh = new h(paramo);
      try
      {
        int i = 0;
        int j = 0;
        Object localObject1 = paramo.v();
        Object localObject2;
        label145:
        do
        {
          if (!((a.c.w)localObject1).e()) {
            break;
          }
          localObject2 = ((a.c.w)localObject1).d();
          if (m != 0) {
            break label240;
          }
          if (localh.e((a.c.e)localObject2))
          {
            if (!bool) {
              if ((this.I != 0) && ((bool) || (localk1 != null))) {
                if (bool) {
                  break label145;
                }
              }
            }
            int k = localk1.getBool(localObject2) ? 1 : 0;
            if (!bool) {}
            Object localObject3 = localk2 != null ? localk2.get(localObject2) : null;
            if (!bool) {
              if (localObject3 == null) {
                localObject3 = E;
              }
            }
            if (!bool) {
              if ((localObject3 == G) && (k != 0)) {
                i++;
              }
            }
            if (localObject3 == F) {
              j++;
            }
          }
          ((a.c.w)localObject1).f();
        } while (m == 0);
        label240:
        a.c.e locale;
        if ((!bool) && (j > 0))
        {
          localObject1 = a.i.db.a();
          this.Y = 3;
          localObject2 = paramo.v();
          do
          {
            if (!((a.c.w)localObject2).e()) {
              break;
            }
            locale = ((a.c.w)localObject2).d();
            if (bool) {
              return;
            }
            if (m != 0) {
              break label510;
            }
            if (!bool)
            {
              if ((localh.e(locale)) && (localk2.get(locale) == F)) {
                ((x)localObject1).a(locale, true);
              }
              ((a.c.w)localObject2).f();
            }
          } while (m == 0);
          paramo.a(a.f.g.a.t.a, (a.c.k)localObject1);
          if (bool) {
            return;
          }
        }
        else if (i > 0)
        {
          this.Y = 2;
          localObject1 = a.i.db.a();
          localObject2 = paramo.v();
          label466:
          label482:
          do
          {
            if (!((a.c.w)localObject2).e()) {
              break;
            }
            locale = ((a.c.w)localObject2).d();
            if (bool) {
              return;
            }
            if (m != 0) {
              break label510;
            }
            if (!bool)
            {
              if (localh.e(locale))
              {
                if (!bool) {
                  if (this.I != 0)
                  {
                    if (bool) {
                      break label466;
                    }
                    if (localk1 != null)
                    {
                      if (bool) {
                        continue;
                      }
                      if (!localk1.getBool(locale)) {
                        break label482;
                      }
                    }
                  }
                }
                if (localk2.get(locale) == G) {
                  ((x)localObject1).a(locale, true);
                }
              }
              ((a.c.w)localObject2).f();
            }
          } while (m == 0);
          if (bool) {
            return;
          }
          paramo.a(e.x, (a.c.k)localObject1);
        }
      }
      finally
      {
        label510:
        localh.e();
      }
    }
  }
  
  private boolean z()
  {
    boolean bool = j.c;
    int i = this.T != j.a ? 1 : 0;
    if (!bool) {
      if (i != 0) {
        return true;
      }
    }
    if (!bool)
    {
      if (this.Y == 3) {
        return true;
      }
      if (bool) {}
    }
    else if (this.Y == 2)
    {
      return false;
    }
    return this.U;
  }
  
  private ob A()
  {
    zb localzb = new zb();
    localzb.a(true);
    localzb.a(this.M);
    ob localob = new ob(localzb, ob.b, 0.0D, 50.0D);
    localob.a(ob.b);
    localob.c(0.0D);
    return localob;
  }
  
  private a.f.g.a.d i(a.f.o paramo)
  {
    boolean bool = j.c;
    int i = j.b;
    a.f.g.a.d locald = new a.f.g.a.d(false);
    locald.q();
    Object localObject;
    if (!bool) {
      if (this.I != 0)
      {
        localObject = new bc()
        {
          public void a(a.f.g.a.bb paramAnonymousbb, xb paramAnonymousxb)
          {
            boolean bool = j.c;
            int i = j.b;
            a.f.o localo = paramAnonymousxb.m();
            a.c.k localk = localo.c(f.C);
            if (localk != null)
            {
              a.c.w localw = localo.v();
              do
              {
                if (!localw.e()) {
                  break;
                }
                a.c.e locale = localw.d();
                if (!bool)
                {
                  if (!localk.getBool(locale)) {
                    paramAnonymousxb.d(locale).f(1.0D);
                  }
                  localw.f();
                }
              } while (i == 0);
            }
          }
        };
        locald.i((bc)localObject);
      }
    }
    if (h.c(paramo))
    {
      localObject = new a.f.g.a.o();
      if (bool) {
        break label143;
      }
      if (i == 0) {}
    }
    else
    {
      localObject = new a.f.g.a.q();
      if (bool) {
        break label143;
      }
      if (this.Y == 3) {
        locald.a(new a.f.g.a.t());
      }
    }
    ((a.f.g.a.o)localObject).h(this.J);
    locald.a((fb)localObject);
    locald.a(K());
    locald.b(K());
    locald.i(this.O);
    label143:
    eb localeb = (eb)locald.T();
    localeb.a((this.y * this.x * 0.8D));
    double d = this.x;
    if (!bool)
    {
      if (this.U)
      {
        localeb.a(0.6D - 0.57D * d);
        localeb.b(0.3D - 0.29D * d);
        ((a.f.g.a.o)localObject).g(((a.f.g.a.o)localObject).k() * 10.0D);
        if (bool) {
          break label289;
        }
        if (i == 0) {}
      }
      else
      {
        localeb.a(0.6D - 0.585D * d);
      }
    }
    else {
      localeb.b(0.3D - 0.295D * d);
    }
    this.T.a(locald);
    if ((bool) || (this.U))
    {
      label289:
      ob localob = A();
      localob.c(((a.f.g.a.o)localObject).e());
      locald.a(localob);
    }
    return locald;
  }
  
  private void B()
  {
    this.w = System.currentTimeMillis();
  }
  
  private boolean C()
  {
    if (!j.c) {}
    return System.currentTimeMillis() - this.w > this.y;
  }
  
  private d D()
  {
    if (this.I != 0) {
      return null;
    }
    d locald = new d();
    locald.i(this.O);
    return locald;
  }
  
  private e F()
  {
    return new e();
  }
  
  private void a(d paramd)
  {
    boolean bool = j.c;
    paramd.q();
    if (!bool)
    {
      if (!n()) {
        paramd.e(true);
      }
      paramd.a(new a.f.c.d());
    }
    if (!bool) {}
    paramd.h(this.x > 0.0D);
    paramd.c((int)this.L);
    paramd.i(this.O);
    paramd.j(this.N);
    if (!bool) {
      if (this.x > 0.1D)
      {
        paramd.b(2 + (int)(this.x * 8.0D));
        paramd.a(8 + (int)(this.x * 22.0D));
        paramd.d(15);
        if (!bool) {
          if (j.b == 0) {
            return;
          }
        }
      }
      else
      {
        paramd.b(2 + (int)(28.0D * this.x / 0.1D));
        paramd.a(25 + (int)(92.0D * this.x / 0.1D));
      }
    }
    paramd.d(15);
  }
  
  private void a(e parame, a.c.k paramk)
  {
    boolean bool = j.c;
    int i = j.b;
    parame.q();
    parame.c((int)this.L);
    parame.d((byte)2);
    parame.c((byte)0);
    parame.i(false);
    parame.h(this.O);
    parame.c(this.I);
    if (!bool) {
      if (this.J == 0.0D)
      {
        parame.d(0.0D);
        parame.b(0);
        parame.a(0);
        parame.a(0.0D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.2D)
      {
        parame.d(0.0D);
        parame.b(1);
        parame.a(0);
        parame.a(0.1D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.4D)
      {
        parame.d(0.0D);
        parame.b(1);
        parame.a(1);
        parame.a(0.2D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.5D)
      {
        parame.d(0.0D);
        parame.b(1);
        parame.a(1);
        parame.a(0.3D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.6D)
      {
        parame.d(0.0D);
        parame.b(2);
        parame.a(1);
        parame.a(0.4D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.7D)
      {
        parame.d(0.0D);
        parame.b(2);
        parame.a(2);
        parame.a(0.8D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.8D)
      {
        parame.d(0.1D);
        parame.b(2);
        parame.a(2);
        parame.a(1.0D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool) {
      if (this.J < 0.9D)
      {
        parame.d(0.3D);
        parame.b(2);
        parame.a(2);
        parame.a(1.0D);
        if (bool) {
          break label496;
        }
        if (i == 0) {
          break label492;
        }
      }
    }
    if (!bool)
    {
      if (this.J < 1.0D)
      {
        parame.d(0.6D);
        parame.b(2);
        parame.a(2);
        parame.a(1.0D);
      }
    }
    else
    {
      if (bool) {
        break label496;
      }
      if (i == 0) {
        break label492;
      }
    }
    parame.d(4.0D);
    parame.b(2);
    parame.a(2);
    parame.a(1.0D);
    label492:
    if (!s()) {
      label496:
      parame.a(a());
    }
    if (!bool) {
      if (!this.N) {
        if (bool) {
          break label533;
        }
      }
    }
    label533:
    parame.j(this.eb);
    parame.a((this.y * this.x * 0.8D));
    parame.c(2.0D - this.x);
    parame.e(1.0D + this.x * this.x * 100.0D);
    parame.a(new e_(new d_(w(), paramk)));
  }
  
  public double G()
  {
    return this.x;
  }
  
  public void c(double paramDouble)
  {
    if ((j.c) || ((paramDouble < 0.0D) || (paramDouble > 1.0D))) {
      throw new IllegalArgumentException("Ratio must lie within [0,1]");
    }
    this.x = paramDouble;
  }
  
  public long H()
  {
    return this.y;
  }
  
  public void a(long paramLong)
  {
    if (paramLong < 0L) {
      throw new IllegalArgumentException("Maximum duration must be non-negative.");
    }
    this.y = paramLong;
  }
  
  public byte I()
  {
    return this.I;
  }
  
  public void b(byte paramByte)
  {
    this.I = paramByte;
  }
  
  public double J()
  {
    return this.J;
  }
  
  public void d(double paramDouble)
  {
    if ((j.c) || ((paramDouble < 0.0D) || (paramDouble > 1.0D))) {
      throw new IllegalArgumentException("Compactness must lie within [0,1]");
    }
    this.J = paramDouble;
  }
  
  public double K()
  {
    return this.L;
  }
  
  public void e(double paramDouble)
  {
    this.L = paramDouble;
  }
  
  public double L()
  {
    return this.M;
  }
  
  public void f(double paramDouble)
  {
    this.M = paramDouble;
  }
  
  public boolean M()
  {
    return this.N;
  }
  
  public void m(boolean paramBoolean)
  {
    this.N = paramBoolean;
  }
  
  public boolean O()
  {
    return this.O;
  }
  
  public void n(boolean paramBoolean)
  {
    this.O = paramBoolean;
  }
  
  public double P()
  {
    return this.Q;
  }
  
  public void g(double paramDouble)
  {
    this.Q = paramDouble;
  }
  
  public boolean Q()
  {
    return this.R;
  }
  
  public void o(boolean paramBoolean)
  {
    this.R = paramBoolean;
  }
  
  public void a(j paramj)
  {
    this.T = paramj;
  }
  
  public j R()
  {
    return this.T;
  }
  
  static final class e_
    implements g
  {
    private final g a;
    
    public e_(g paramg)
    {
      this.a = paramg;
    }
    
    public Rectangle2D a(a.f.o paramo, a.c.e parame, a.c.bb parambb)
    {
      if (parambb.isEmpty())
      {
        Rectangle2D localRectangle2D = this.a.a(paramo, parame, parambb);
        double d1 = paramo.m(parame);
        double d2 = paramo.n(parame);
        localRectangle2D.setFrame(d1 - localRectangle2D.getWidth() * 0.5D, d2 - localRectangle2D.getHeight() * 0.5D, localRectangle2D.getWidth(), localRectangle2D.getHeight());
        return localRectangle2D;
      }
      return this.a.a(paramo, parame, parambb);
    }
  }
  
  static final class d_
    implements g
  {
    private final g a;
    private a.c.k b = null;
    private Object c = null;
    
    public d_(g paramg, Object paramObject)
    {
      this.c = paramObject;
      this.a = paramg;
    }
    
    public d_(g paramg, a.c.k paramk)
    {
      this.b = paramk;
      this.a = paramg;
    }
    
    public Rectangle2D a(a.f.o paramo, a.c.e parame, a.c.bb parambb)
    {
      boolean bool = j.c;
      if (!bool) {
        if (this.c != null) {
          this.b = paramo.c(this.c);
        }
      }
      if (!bool) {
        if (this.b != null)
        {
          if (bool) {
            break label76;
          }
          if (this.b.getBool(parame)) {
            break label72;
          }
        }
      }
      return this.a.a(paramo, parame, parambb);
      label72:
      if (parambb.isEmpty())
      {
        label76:
        localObject1 = paramo.d(parame);
        if ((bool) || ((((zc)localObject1).c() == 0.0D) || (((zc)localObject1).d() == 0.0D)))
        {
          localObject2 = this.a.a(paramo, parame, parambb);
          ((zc)localObject1).b(((Rectangle2D)localObject2).getWidth(), ((Rectangle2D)localObject2).getHeight());
        }
        return new Rectangle2D.Double(((zc)localObject1).a(), ((zc)localObject1).b(), ((zc)localObject1).c(), ((zc)localObject1).d());
      }
      Object localObject1 = this.a.a(paramo, parame, parambb);
      Object localObject2 = paramo.d(parame);
      double d1 = Math.min(((Rectangle2D)localObject1).getX(), ((zc)localObject2).a());
      double d2 = Math.min(((Rectangle2D)localObject1).getY(), ((zc)localObject2).b());
      double d3 = Math.max(((Rectangle2D)localObject1).getMaxX(), ((zc)localObject2).a() + ((zc)localObject2).c());
      double d4 = Math.max(((Rectangle2D)localObject1).getMaxY(), ((zc)localObject2).b() + ((zc)localObject2).d());
      ((Rectangle2D)localObject1).setFrame(d1, d2, d3 - d1, d4 - d2);
      return localObject1;
    }
  }
  
  class k_
    extends p
  {
    private a.c.k c;
    private a.c.k d;
    private a.f.o e;
    
    k_(a.f.o paramo)
    {
      this.e = paramo;
      this.c = paramo.c(f.D);
      this.d = paramo.c(f.C);
    }
    
    public boolean getBool(Object paramObject)
    {
      boolean bool2 = j.c;
      a.c.e locale = (a.c.e)paramObject;
      if (!bool2) {
        if (!f.this.a(locale, this.c, this.e))
        {
          if (bool2) {
            break label85;
          }
          if (!f.this.a(locale, this.c))
          {
            if ((!bool2) && (this.d == null)) {
              break label88;
            }
            if (bool2) {
              break label85;
            }
          }
        }
      }
      label85:
      label88:
      boolean bool1 = !this.d.getBool(locale);
      return bool1;
    }
  }
  
  class c_
  {
    private a.f.o a;
    private q.d_ c = null;
    private a.c.e[] e = null;
    
    public c_(a.f.o paramo)
    {
      this.a = paramo;
    }
    
    public void a(x paramx)
    {
      boolean bool = j.c;
      int m = j.b;
      a.c.bb localbb1 = new a.c.bb();
      a.c.bb localbb2 = new a.c.bb();
      x localx1 = a.i.db.a();
      x localx2 = a.i.db.a();
      x localx3 = a.i.db.a();
      h localh = new h(this.a);
      Object localObject1 = this.a.v();
      while (((a.c.w)localObject1).e())
      {
        localObject2 = ((a.c.w)localObject1).d();
        localx2.a(localObject2, -1);
        if ((bool) || (paramx != null))
        {
          if (bool) {
            break label163;
          }
          if (!paramx.getBool(localObject2)) {}
        }
        else
        {
          localbb1.add(localObject2);
        }
        localx1.a(localObject2, localh.e((a.c.e)localObject2));
        localx3.a(localObject2, localh.b((a.c.e)localObject2));
        label163:
        if (!bool)
        {
          if ((localh.e((a.c.e)localObject2)) && (localh.b((a.c.e)localObject2) == localh.d())) {
            localbb2.add(localObject2);
          }
          ((a.c.w)localObject1).f();
        }
        if (m != 0)
        {
          if (!bool) {}
          a.c.q.n = !a.c.q.n;
        }
      }
      localObject1 = new ab();
      Object localObject2 = localbb2.l();
      label341:
      do
      {
        if (!((a.c.w)localObject2).e()) {
          break;
        }
        localObject3 = ((a.c.w)localObject2).d();
        if (m != 0) {
          break label379;
        }
        localObject4 = localh.g((a.c.e)localObject3).l();
        do
        {
          do
          {
            if (!((m)localObject4).e()) {
              break label341;
            }
            localObject5 = ((m)localObject4).a();
            if (m != 0) {
              break;
            }
            if (((a.c.d)localObject5).f() != localObject3) {
              ((ab)localObject1).add(this.a.a(((a.c.d)localObject5).e(), (a.c.e)localObject3));
            }
            ((m)localObject4).f();
          } while (m == 0);
          ((a.c.w)localObject2).f();
        } while (bool);
      } while (m == 0);
      if (!bool) {
        localh.e();
      }
      label379:
      localObject2 = new h(this.a);
      Object localObject3 = localbb2.l();
      Object localObject6;
      label484:
      do
      {
        if (!((a.c.w)localObject3).e()) {
          break;
        }
        localObject4 = ((a.c.w)localObject3).d();
        localObject5 = ((h)localObject2).h((a.c.e)localObject4).l();
        do
        {
          do
          {
            if (!((m)localObject5).e()) {
              break label484;
            }
            localObject6 = ((m)localObject5).a();
            if (m != 0) {
              break;
            }
            if (((a.c.d)localObject6).e() != localObject4) {
              ((ab)localObject1).add(this.a.a((a.c.e)localObject4, ((a.c.d)localObject6).f()));
            }
            ((m)localObject5).f();
          } while (m == 0);
          ((a.c.w)localObject3).f();
        } while (bool);
      } while (m == 0);
      localObject3 = new y(this.a);
      Object localObject4 = localbb2.l();
      if (((a.c.w)localObject4).e()) {}
      do
      {
        ((y)localObject3).a(((h)localObject2).d(((a.c.w)localObject4).d()));
        ((a.c.w)localObject4).f();
        if (bool) {
          break label604;
        }
        if (m != 0) {
          break label584;
        }
        if (m == 0) {
          break;
        }
        ((h)localObject2).e();
      } while (bool);
      ((y)localObject3).e();
      label584:
      label604:
      int i = a.a.n.a(this.a, localx2, f.this.cb, 0, 2147483647, false);
      ((y)localObject3).g();
      Object localObject5 = ((ab)localObject1).l();
      if (((m)localObject5).e()) {}
      do
      {
        this.a.a(((m)localObject5).a());
        ((m)localObject5).f();
        if (bool) {
          break label694;
        }
        if (m != 0) {
          break label693;
        }
        if (m == 0) {
          break;
        }
        this.e = new a.c.e[i];
      } while (bool);
      this.c = new q.d_(this.a);
      label693:
      label694:
      int j = 0;
      if (j < this.e.length) {
        this.e[j] = this.a.i();
      }
      while (bool)
      {
        this.a.b(this.e[j], 1.0D, 1.0D);
        localx1.a(this.e[j], true);
        paramx.a(this.e[j], true);
        j++;
        if ((!bool) && (m != 0)) {
          break label800;
        }
        if (m == 0) {
          break;
        }
      }
      this.c.a(a.f.c.i.c, localx1);
      label800:
      a.c.w localw = localbb1.l();
      do
      {
        if (!localw.e()) {
          break;
        }
        localObject6 = localw.d();
        int k = localx2.getInt(localObject6);
        if ((!bool) && (m != 0)) {
          break label930;
        }
        if (!bool)
        {
          if (k >= 0) {
            localx3.a(localObject6, this.e[k]);
          }
          localw.f();
        }
      } while (m == 0);
      this.c.a(a.f.c.i.b, localx3);
      this.c.a(a.f.c.i.a, new f.6(this));
      if (!bool) {
        this.c.a(f.C, paramx);
      }
      label930:
      if (bool) {
        a.c.q.o = !a.c.q.o;
      }
    }
    
    public void a()
    {
      boolean bool = j.c;
      int j = j.b;
      if (!bool)
      {
        if (this.e != null)
        {
          int i = 0;
          do
          {
            if (i >= this.e.length) {
              break;
            }
            this.a.a(this.e[i]);
            i++;
            if ((!bool) && (j != 0)) {
              return;
            }
          } while (j == 0);
        }
        if (bool) {}
      }
      else if ((bool) || (this.c != null))
      {
        this.c.a();
      }
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.f.g.f

 * JD-Core Version:    0.7.0.1

 */